<%@page import="java.util.Random"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>??</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
	<%
		int grade = 90;
		request.setAttribute("grade", grade);
		List list = new ArrayList<Integer>();
		for (int i = 0; i < 5; i++) {
			list.add(new Random().nextInt(100));
		}
		request.setAttribute("list", list);
	%>
	<s:if test="#request.grade>80">
			优秀
		</s:if>
	<s:elseif test="#request.grade>=60">
			合格		
		</s:elseif>

	<s:iterator value="#request.list" status="var" var="it">
		<s:property value="it" />
	</s:iterator>
	<s:iterator value="#{1: '中国', 2: '美国', 3: '日本'}" var="cur">
		<s:property value="#cur.key" />
		<s:property value="#cur.value" />
		<br />
	</s:iterator>
	<br />
	<s:a action="login" namespace="/helloaction">链接</s:a>
	<br />

	<s:url action="logout" namespace="/action" var="id">
		<!--  英文中文必须加单引号 -->
		<s:param name="kk" value="'java'"></s:param>
		<!-- 数字可以不加引号 -->
		<s:param name="kk2" value="123"></s:param>
	</s:url>
	<s:property value="id" />
	<br />
	
	<br />


	<s:form name="form1">
		<s:combobox name="my" list="#{1:'java',2:'delphi',3:'c#'}"></s:combobox>
		<br />
		<s:set var="shengShiDoubleList"
			value="#{'吉林省':{'吉林市','长春市'},'黑龙江省':{'大庆市','哈尔滨市'},'辽宁省':{'沈阳市','大连市','盘锦市'}}"></s:set>
		<s:doubleselect doubleList="#shengShiDoubleList[top]"
			list="#shengShiDoubleList.keySet()" doubleName="shiSimple"
			name="shengSimple" formName="form1">
		</s:doubleselect>
	</s:form>
	
	 <s:append var="books1">
        <s:param name="p1" value="#{'C++入门经典':'清华出版社','Java编程思想':'清华出版社'}"/>
        <s:param name="p2" value="#{'Ajax权威指南','Ruby元编程','C#高级编程'}" />
    </s:append>
    <!-- map 遍历中本身提供了一个key value -->
    <s:iterator value="books1" >
        <s:property value="key" />|<s:property value="value" /><BR/>
    </s:iterator>
    <!-- var 作用是valueContext存放值 -->
    <s:generator var="books" separator="," val="'java,C#,cpp,C,pythod,ruby,android'"></s:generator>
    
    <s:iterator value="#books" var="it">
    	<s:property value="it"/>
    </s:iterator>

</body>
</html>